package com.example.llm.learn.springmcp;

import com.example.llm.learn.springmcp.tools.PhoneService;
import com.example.llm.learn.springmcp.tools.WeatherService;
import org.springframework.ai.tool.ToolCallbackProvider;
import org.springframework.ai.tool.method.MethodToolCallbackProvider;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.Bean;

/**
 * @author chenglei
 * @description:
 * @date 2025-05-07 9:20
 * @email
 */
@SpringBootApplication
public class CustomWebmvcMcpServerApplication {
    public static void main(String[] args) {
        SpringApplication.run(CustomWebmvcMcpServerApplication.class, args);
    }

    @Bean
    public ToolCallbackProvider weatherTools(WeatherService weatherService, PhoneService phoneService) {
        return MethodToolCallbackProvider.builder().toolObjects(weatherService, phoneService).build();
    }

}
